package com.xiaozhichao.javaapi.base.nulltest;

import org.junit.Test;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class NullTest {

    /**
     * 测试Iterator空值问题
     */
    @Test
    public void iterableTest(){
        Map<String,Double> map = new HashMap<>();
        map.put(null,67D);
        map.put(null,68D);
        map.put("key1",null);
        map.put("key2",9D);
        Iterator<Double> iterator = map.values().iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
